package com.example.gzysmartcity.ui.adapter;

import androidx.cardview.widget.CardView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.gzysmartcity.R;
import com.example.gzysmartcity.repository.model.SupplyNum;

import org.jetbrains.annotations.NotNull;

public class FactoryAdpater extends BaseQuickAdapter<SupplyNum, BaseViewHolder> {
    int posi=0;
    public FactoryAdpater(int layoutResId) {
        super(layoutResId);
    }
    public void getPosotionColors(int p){
        this.posi=p;
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, SupplyNum supplyNum) {
        baseViewHolder.setText(R.id.rv_factory_name,supplyNum.getName());
        baseViewHolder.setText(R.id.rv_factory_num,supplyNum.getNum()+"");
        CardView cardView=baseViewHolder.getView(R.id.rv_factory_cardView);
//        if (posi==baseViewHolder.getAdapterPosition()){
//            cardView.setCardBackgroundColor(Color.GRAY);
//        }else {
//            cardView.setCardBackgroundColor(Color.WHITE);
//        }
    }
}
